# -*- coding: utf-8 -*-


class OrderStyle(object):
    def get_style(self):
        raise NotImplementedError

    def get_limit_price(self):
        raise NotImplementedError

    def info(self):
        raise NotImplementedError

# 市价单. 不管股价会涨还是跌, 按照市场价进行交易
class MarketOrder(OrderStyle):

    def info(self):
        return "MKT"

    def get_style(self):
        return "MKT"

    def get_limit_price(self):
        return None

# 限价单, 限制一个价格, 如果当天的价格过高了, 就不买了, 过低了, 就不卖了
class LimitOrder(OrderStyle):

    def __init__(self, limit_price):
        self.limit_price = float(limit_price)

    def info(self):
        return "LMT (" + str(self.limit_price) + ")"

    def get_style(self):
        return "LMT"

    def get_limit_price(self):
        return self.limit_price